package com.ccz.demo.Concurrency.basic;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;

/**
 * @ClassName Demo
 * @Author caihaoyun
 * @Date 2020/5/4
 * @Version V1.0
 **/
public class Demo1 {

    public static class MyThread implements Runnable {
        int j=0;
        @Override
        public void run() {
            for (int i = 0; i <= 5; i++) {
//                System.out.println(Thread.currentThread().getName()+",j="+this.j--);
                System.out.println("j数字" + j);
                j++;
            }
        }
    }

    public static void main(String[] args) {
        List<Demo> list = new ArrayList<>();
        list.add(new Demo("1", 1));
        list.add(new Demo("2", 2));
        CountDownLatch countDownLatch = new CountDownLatch(5);
//        list.stream().map()

//        MyThread myThread = new MyThread();
//        Thread t1 = new Thread(myThread);
//        Thread t2 = new Thread(myThread);
//
//
//        t1.start();
//        t2.start();
//        System.out.println("...................");
//        System.out.println("...................");
//        System.out.println("...................");
//        System.out.println("...................");

    }

}
